package hesso.smartdraw.ch.guielements;

import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.input.touch.TouchEvent;
import org.anddev.andengine.opengl.texture.region.TextureRegion;

public abstract class DeviceScreenElement extends Sprite{

	public DeviceScreenElement(float pX, float pY, TextureRegion pTextureRegion) {
		super(pX, pY, pTextureRegion);
	}
	
	@Override
    public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
            switch(pSceneTouchEvent.getAction()) {
                    case TouchEvent.ACTION_DOWN:
                    	this.actionDown();
                            break;

                    case TouchEvent.ACTION_MOVE:
                    	this.actionMove();
                            break;
                    case TouchEvent.ACTION_UP:
                    	this.actionUp();
                            break;
            }
            return true;
    }
	
	public abstract void actionDown();
	public abstract void actionMove();
	public abstract void actionUp();

}
